//
//  SHReturnToken.m
//  youjian03
//
//  Created by mac mini on 14-10-23.
//  Copyright (c) 2014年 com.shouhuobao. All rights reserved.
//

#import "SHReturnToken.h"

@interface SHReturnToken()



@end

@implementation SHReturnToken

+(NSString *)returnTokenNo
{
    
    
    NSString *token = nil;
    // 1.获得数据库文件的路径
    NSString *doc = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];
    NSString *filename = [doc stringByAppendingPathComponent:@"youjian.sqlite"];
    
    
    // 2.得到数据库
    FMDatabase *db = [FMDatabase databaseWithPath:filename];
    if([db open])
    {
        FMResultSet *resultset =  [db executeQuery:@"select * from userinfo"];
        while ([resultset next]) {
             token = [resultset stringForColumn:@"token"];
            
        }
        
    }
    return  token;
    

    
    
    
}
@end
